/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-08-18 07:40:34
 * @LastEditors: GGB
 * @LastEditTime: 2021-08-18 10:11:32
 */
import 'package:flutter/material.dart';
import 'package:flutter_data_center/components/animation_text.dart';
import 'package:flutter_data_center/components/loading.dart';
import 'package:flutter_data_center/controller/wristband_controller.dart';
import 'package:flutter_data_center/utills/color_utils.dart';
import 'package:get/get.dart';
import 'package:line_icons/line_icons.dart';

class WristbandDetailCard extends StatelessWidget {
  const WristbandDetailCard({Key key, this.tag}) : super(key: key);
  final String tag;

  @override
  Widget build(BuildContext context) => GetBuilder<WristbandController>(
        builder: (_controller) => Container(
          height: 105,
          padding: EdgeInsets.only(left: 20, top: 20, right: 20, bottom: 15),
          width: double.infinity,
          decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(15),
            color: gColor("#EDFFC6"),
            boxShadow: [
              BoxShadow(
                offset: Offset(0, 0),
                blurRadius: 10,
                color: Color.fromRGBO(124, 179, 4, 0.2),
              ),
            ],
          ),
          child: Row(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Hero(
                tag: tag,
                child: ClipOval(
                  child: Image.network(
                    "https://images.pexels.com/photos/1840608/pexels-photo-1840608.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260",
                    fit: BoxFit.cover,
                    width: 47,
                    height: 47,
                  ),
                ),
              ),
              SizedBox(
                width: 30,
              ),
              Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  Text(
                    "小明",
                    style: TextStyle(
                      fontSize: 24,
                    ),
                  ),
                  Text(
                    "小明",
                    style: TextStyle(
                      fontSize: 18,
                    ),
                  ),
                ],
              ),
              Spacer(),
              Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  _controller.detail != null
                      ? AnimText(
                          number: _controller.detail.total,
                          style: TextStyle(
                            fontSize: 24,
                          ),
                        )
                      : Loading(size: 20),
                  Icon(LineIcons.running),
                ],
              ),
            ],
          ),
        ),
      );
}
